import axios from '@/api/fetch';
import SERVER from '@/api/server';

//备件订单代提报主查询
export const orderProxyReportFind = params => axios.get(`${SERVER.CMSCLOUD_WMS}/aduit/order/orderProxyReportFind`, { params });
//查询备件
export const findPartInfo = params => axios.get(`${SERVER.CMSCLOUD_WMS}/aduit/order/findPartInfo`, { params });
// 备件选择
export const orderChoose = (params) => axios.get(`${SERVER.CMSCLOUD_WMS}/part/submission/part/list/page`, { params })
// 导入备件
export const importPart = (params,stockInType) => axios.post(`${SERVER.CMSCLOUD_WMS}/aduit/order/importPart?stockInType=`+stockInType,  params )
//查询库存 Check Stock
export const checkStock = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/delivertosap/traceOrde/asnyPartStore2dlr`,  params )
//保存或修改
export const saveOrUpdate = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/part/submission/saveOrUpdate`,  params )
//查询替换件 
// export const getSubPartList = (params) => axios.get(`${SERVER.CMSCLOUD_WMS}/part/partinfo/getSubPartList`, { params })
export const getSubPartList = (params) => axios.get(`${SERVER.CMSCLOUD_WMS}/part/submission/part/replace/list/page`, { params })
// 查询是否免运费
export const checkReport = (params) => axios.get(`${SERVER.CMSCLOUD_WMS}/aduit/order/checkReport`,  {params} )
// 提报
export const report = (params,bool) => axios.post(`${SERVER.CMSCLOUD_WMS}/part/submission/report/`+bool,  params )
// 作废订单
export const cancelOrder = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/aduit/order/cancelOrder?orderId=`+params )
// 根据订单ID查询订单明细
export const findOrderDetailByOrderId = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/aduit/order/findOrderDetailByOrderId?orderId=`+params )
// 查询活动配件
export const searchServiceActivities = (params) => axios.get(`${SERVER.DMSCLOUD_ACTIVITY}/ttRpMa/searchServiceActivities`,{params} )
// 查询活动配件
export const searchDetailedBymaNo = (params) => axios.get(`${SERVER.DMSCLOUD_ACTIVITY}/ttRpMa/searchDetailedBymaNo?maNo=`+params )
// 根据备件编号查询备件信息
export const activatedPart = (params) => axios.post(`${SERVER.CMSCLOUD_WMS}/part/submission/find/activatedPart`,params )